﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Spring.Objects.Factory.Config;

namespace Strongshell.Recoil.Core.Composition.Parsing.DependencyInjection
{
    public abstract class DependencyInjectorBase : IDependencyInjector
    {
        protected ObjectConfiguration ObjectConfiguration { get; set; }

        public Type ExpectedType { get; set; }

        protected DependencyInjectorBase(ObjectConfiguration currentConfiguration, Type expectedType)
        {
            ObjectConfiguration = currentConfiguration;
            ExpectedType = expectedType;
        }

        public virtual ObjectConfiguration SelectObjectConfiguration()
        {
            return ObjectConfiguration;
        }

        public virtual ObjectConfiguration SelectNestableObjectConfiguration(Type type)
        {
            throw new NotSupportedException(String.Format("{0} doesn't support nestable object configurations.", GetType()));

        }

        public abstract void Inject(object value);
    }
}